package com.gin.pixiv.enums

import com.fasterxml.jackson.annotation.JsonCreator

/**
 * @author bx002
 * @since 2024/2/18 15:04
 */
enum class IllustrationType() {
    /**
     * 插画
     */
    ILLUSTRATION,

    /**
     * 漫画
     */
    MANGA,

    /**
     * 动图
     */
    UGOIRA,
    ;

    companion object {
        @JsonCreator
        @JvmStatic
        fun creator(i: Int): IllustrationType {
            return when (i) {
                0 -> ILLUSTRATION
                1 -> MANGA
                2 -> UGOIRA
                else -> throw RuntimeException("unacceptable value: $i")
            }
        }
    }

}